<?php
uses('controller');

class smsController extends Controller {

    function __construct() {
        parent::__construct();
    }

    function sendSms() {
        $result = $this->model->sendSms();

        switch($result['code']['sendSms']) {
            case '1':
                $msg = 'a sms has been send.';
                break;
            case '2':
                $msg = 'sms send error.msg:'.$result['err'];
                $die = true;
                break;
            case '4':
                $msg = 'no sms need to send.';
                break;
            default:
                $msg = 'unknow stat.';
                $die = true;
        }

        if ($die) die($msg);
    }
}
?>